<template>
  <div class="card">
    <img :src="item.thumb_img" alt="" />
    <div class="detail">
      <h5>{{ item.title }}</h5>
      <p>{{ item.description }}</p>
      <div class="time">
        <div>
          <span class="iconfont icon-yanjing"></span>
          <span>{{ item.click_rate }}</span>
        </div>
        <div>
          <span class="iconfont icon-naozhong"></span>
          <span>{{ item.created_at | times}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    item: Object,
  },
  data() {
    return {};
  },
  mounted() {},
  methods: {},
  components: {},
  filters: {
    times(val) {
         var time = new Date(val * 1000);
         return time.toLocaleString("chinese", { hour12: false });
    },
  },
};
</script>

<style lang='scss' scoped>
.card {
  width: 94%;
  height: 100px;
  background-color: #fff;
  display: flex;
  // justify-content: space-between;
  padding: 5px;
  align-items: center;
  margin: 10px auto;
  box-shadow: 0 0 5px 5px #eee;
  border-radius: 5px;
  img {
    width: 30%;
    height: 80%;
    margin-right: 10px;
  }
  .detail {
    width: 70%;
    height: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    h5 {
      font-weight: normal;
    }
    p {
      color: #ccc;
    }
    .time {
      display: flex;
      justify-content: space-between;
      padding: 0 10px;
      color: #ccc;
      .icon-yanjing {
      }
    }
  }
}
</style>
